﻿using System.Diagnostics;
using System.IO;

namespace Common
{
    public static class PathUtils
    {

        private static string GetStartupPath()
        {
            return Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName);
        }

        /// <summary>
        /// Returns the absolute path for a file in the same directory as the executing assembly.
        /// </summary>
        /// <param name="filename"></param>
        /// <returns></returns>
        public static string GetAbsolutePath(string filename)
        {
            return Path.Combine(GetStartupPath(), filename);
        }
    }
}

